/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Keith Augustsson
 */
@Embeddable
public class ConsistsofPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "flight")
    private String flight;
    @Basic(optional = false)
    @Column(name = "arrDate")
    @Temporal(TemporalType.DATE)
    private Date arrDate;
    @Basic(optional = false)
    @Column(name = "depDate")
    @Temporal(TemporalType.DATE)
    private Date depDate;
    @Basic(optional = false)
    @Column(name = "tripNr")
    private String tripNr;

    public ConsistsofPK(String flight, Date arrDate, Date depDate, String tripNr) {
        this.flight = flight;
        this.arrDate = arrDate;
        this.depDate = depDate;
        this.tripNr = tripNr;
    }

    public String getFlight() {
        return flight;
    }

    public void setFlight(String flight) {
        this.flight = flight;
    }

    public Date getArrDate() {
        return arrDate;
    }

    public void setArrDate(Date arrDate) {
        this.arrDate = arrDate;
    }

    public Date getDepDate() {
        return depDate;
    }

    public void setDepDate(Date depDate) {
        this.depDate = depDate;
    }

    public String getTripNr() {
        return tripNr;
    }

    public void setTripNr(String tripNr) {
        this.tripNr = tripNr;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (flight != null ? flight.hashCode() : 0);
        hash += (arrDate != null ? arrDate.hashCode() : 0);
        hash += (depDate != null ? depDate.hashCode() : 0);
        hash += (tripNr != null ? tripNr.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConsistsofPK)) {
            return false;
        }
        ConsistsofPK other = (ConsistsofPK) object;
        if ((this.flight == null && other.flight != null) || (this.flight != null && !this.flight.equals(other.flight))) {
            return false;
        }
        if ((this.arrDate == null && other.arrDate != null) || (this.arrDate != null && !this.arrDate.equals(other.arrDate))) {
            return false;
        }
        if ((this.depDate == null && other.depDate != null) || (this.depDate != null && !this.depDate.equals(other.depDate))) {
            return false;
        }
        if ((this.tripNr == null && other.tripNr != null) || (this.tripNr != null && !this.tripNr.equals(other.tripNr))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.ConsistsofPK[flight=" + flight + ", arrDate=" + arrDate + ", depDate=" + depDate + ", tripNr=" + tripNr + "]";
    }

}
